Select a proper ext flash interface for varius boards #28985
Select a proper ext flash interface for varius boards #28985ArekBalysNordic wants to merge 6 commits into
Conversation
ArekBalysNordic
commented
May 25, 2026
- Allow building nRF54LM20 with nRF70 patch stored on external flash support. Thanks to that we can save some memory in the internal memory.
- When WiFi FW patches are stored on SPI (not QSPI), do not assume a generic "spi" nodelabel. Locate the external flash via compatible "jedec,spi-nor" with dt_comp_path and derive the SPI controller ath from that node using get_filename_component.
|
You can find the documentation preview for this PR here. |
CI InformationTo view the history of this post, click the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 01c0585b53982723ff48e0dffadc299c82bd4ced more detailssdk-nrf:
Github labels
List of changed files detected by CI (14)Outputs:ToolchainVersion: f0aa129f09 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
Memory footprint analysis revealed the following potential issuesapplications.hpf.gpio.mbox[nrf54l15dk/nrf54l15/cpuflpr]: High RAM usage: 7202[B] - link (cc: @nrfconnect/ncs-ll-ursus) Note: This message is automatically posted and updated by the CI (latest/sdk-nrf/PR-28985/4) |
Adam-Maciuga
left a comment
There was a problem hiding this comment.
This builds for me but doesn't boot.
Possibly the offset and signing fixes from my test PR are still required for it to work properly. If this PR alone works for you, how did you build it and flashed it?
| get_filename_component(spi_path "${spi_nor_path}" DIRECTORY) | ||
| dt_reg_addr(interface_xip_address TARGET ${DEFAULT_IMAGE} PATH "${spi_path}") |
There was a problem hiding this comment.
This sets the interface_xip_address to range 0x5004xxxx.
Looking at for all our other chips the flash is in range 0x1xxxxxxx
Shouldn't we keep it like that, so that it is consistent?
set(interface_xip_address 0x10000000)
Would set it.
If we keep it like that, I will have to update the zephyr upstream PR to reflect this address change, currently a combination of this PR and my zephyr PR is not flashable to the board
There was a problem hiding this comment.
You mean chips that use QSPI, however here we have SPI only. So the spi file in Zephyr should be similar to nrf7002DK one.
There was a problem hiding this comment.
I see the issue. It seems that we need to add reg description to the spi node in Zephyr. Then we can use it in the same way as for 5340.
There was a problem hiding this comment.
OK, I've fixed everything here and checked with your PR in Zephyr.
3f4617b to
732c578
Compare
| function(setup_nrf700x_xip_data) | ||
| dt_nodelabel(qspi_nodelabel TARGET ${DEFAULT_IMAGE} NODELABEL "qspi") | ||
| dt_reg_addr(qspi_xip_address TARGET ${DEFAULT_IMAGE} PATH "${qspi_nodelabel}" NAME "qspi_mm") | ||
|
|
| choice WIFI_PATCHES_EXT_FLASH_STORE_INTERFACE | ||
| bool "External flash interface" | ||
| depends on WIFI_PATCHES_EXT_FLASH_XIP || WIFI_PATCHES_EXT_FLASH_STORE | ||
| default WIFI_PATCHES_EXT_FLASH_STORE_INTERFACE_QSPI if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF52840DK_NRF52840 | ||
| default WIFI_PATCHES_EXT_FLASH_STORE_INTERFACE_SPI | ||
| help | ||
| Select this option to select the interface for external flash access | ||
|
|
||
| config WIFI_PATCHES_EXT_FLASH_STORE_INTERFACE_SPI | ||
| bool "SPI" | ||
| help | ||
| Select this option to use SPI interface for external flash access | ||
|
|
||
| config WIFI_PATCHES_EXT_FLASH_STORE_INTERFACE_QSPI | ||
| bool "QSPI" | ||
| help | ||
| Select this option to use QSPI interface for external flash access | ||
|
|
||
| endchoice |
There was a problem hiding this comment.
no Kconfig is needed for this, just use a chosen property then you can check the node
There was a problem hiding this comment.
OK, it makes sense.
There was a problem hiding this comment.
Changed. Now it is obtained from chosen and according to its compatible property the correct address is taken.
| elseif(SB_CONFIG_WIFI_PATCHES_EXT_FLASH_STORE_INTERFACE_SPI) | ||
| # Multiple SPI controllers may exist; use the sole okay jedec,spi-nor node and its SPI parent. | ||
| dt_comp_path(spi_nor_path TARGET ${DEFAULT_IMAGE} COMPATIBLE "jedec,spi-nor") | ||
|
|
||
| if(NOT DEFINED spi_nor_path) | ||
| message(FATAL_ERROR | ||
| "nRF WiFi FW patch external flash: no devicetree node with compatible \"jedec,spi-nor\"") | ||
| endif() | ||
|
|
||
| get_filename_component(spi_path "${spi_nor_path}" DIRECTORY) | ||
| dt_reg_addr(interface_xip_address TARGET ${DEFAULT_IMAGE} PATH "${spi_path}" NAME "spi_mm") |
There was a problem hiding this comment.
this is why you need a chosen node, rather than picking an arbitrary random potentially wrong node
| reg = <0x001e3000 DT_SIZE_K(132)>; | ||
| }; | ||
|
|
||
| nrf70_wifi_fw_partition: nrf70_fw_partition: partition@1e3800 { |
There was a problem hiding this comment.
I don't see why there is nrf70_wifi_fw_partition and nrf70_fw_partition, only one of these should be needed
There was a problem hiding this comment.
It is because some files in WiFi uses nrf70_wifi_fw_partition name and other nrf70_fw_partition. So AFAIK both are needed. @krish2718 could you please comment on that?
There was a problem hiding this comment.
Pre-sysbuild we had nrf70_fw_partition (https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/nrf70_fw_ext/ext_fw_load.c#L60) but as part of sysbuild migration it was renamed by @nordicjm (2a332d2 but the old one was left as is.
We can fix this to reflect the same, @ArekBalysNordic I can provide you the commit for cherry-picking.
There was a problem hiding this comment.
PR ArekBalysNordic#26 I haven't done any testing using this, I will do it by EoD.
There was a problem hiding this comment.
Added to this PR, thanks!
|
This PR requires an additional commit in Zephyr. Once it will be merged a Zephyr manifest commit will be added here. |
When WiFi FW patches are stored on SPI (not QSPI), do not assume a generic "spi" nodelabel. Locate the external flash via compatible "jedec,spi-nor" with dt_comp_path and derive the SPI controller path from that node using get_filename_component. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
Allow building nRF54LM20 with nRF70 patch stored on external flash support. Thanks to that we can save some memory in the internal memory. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
Added board files dedicated to 54lm20 boards to allow building the ext-flash snippet. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
732c578 to
e96191a
Compare
PARTITION_ID() must use the devicetree node label. Sysbuild and CMake already reference nrf70_wifi_fw_partition; drop the legacy nrf70_fw_partition alias from the loader. Assisted-by: Cursor: Auto Co-authored-by: Cursor <cursoragent@cursor.com>
One node label is enough. Keep nrf70_wifi_fw_partition so it matches sysbuild, partition manager, and the ext flash loader. Assisted-by: Cursor: Auto Co-authored-by: Cursor <cursoragent@cursor.com>
Show the single nrf70_wifi_fw_partition label used by the tree. Assisted-by: Cursor: Auto Co-authored-by: Cursor <cursoragent@cursor.com>